<style type="text/css">
    .table th {
        text-align: center;
        vertical-align: middle!important;
    }
    .table th:nth-child(1), 
    .table td:nth-child(1) {
        width: 10%;
    }  
    .table th:nth-child(2), 
    .table td:nth-child(2)
    {
        width:58%;
    }
    .table th:nth-child(3), 
    .table td:nth-child(3)
    {
        width:20%;
    }
    .table th:nth-child(4), 
    .table td:nth-child(4)
    {
        width:12%;
    }
    .pagination li {
        display: inline;
        margin-left: 0.5em;
        margin-right: 0.5em;
    }
    .red {color: red;}
</style>
<!--Bảng danh sách đơn-->
<div class="col-md-12" style="margin-top: 20px">
        <table id="data-table" class="table table-striped table-bordered" cellspacing="0" width="100%">
            <thead>
                <tr class="label-warning">
                    <th>STT</th>
                    <th>Các loại hồ sơ</th>
                    <th>Hình thức áp dụng</th>
                    <th>Tác vụ</th>
                </tr>
            </thead>
            <tbody>
                @foreach($data as $row)
                @if($row != null)
                <tr>
                    <td class="text-center">{{++$numRows}}</td>
                    <td id="tendon_{{$row->ID}}">{{$row->TEN_BIEU_MAU}}</td>
                    <td>
                        @if($row->STATUS_MAU == 1)
                        <span class="label label-primary">Áp dụng trước khi kiểm tra</span>
                        @else
                        <span class="label label-default">Áp dụng sau khi kiểm tra</span>
                        @endif
                    </td>
                    <td class="text-center">
                        <a href="{{url('ql=chitieths?id='.$row->ID)}}" id="{{$row->ID}}" class="btn btn-success xemBtn btn-sm" onclick="xemMau('{{$row->ID}}')" title="Xem chi tiết {{$row->TEN_BIEU_MAU}}"><span class="glyphicon glyphicon-file"></span></a>
                        <a href="{{url('delete=dshosott?id='.$row->ID)}}" id="{{$row->ID}}" class="delete_hs text-danger btn btn-sm btn-danger" title="Xóa hồ sơ"><i class="glyphicon glyphicon-remove"></i></a>
                    </td>
                </tr>
                @endif
                @endforeach
            </tbody>
        </table>  
        <!--Kết thúc bảng danh sách đơn-->
    </div>
    

<script type="text/javascript">
    $(document).ready(function () {
        $(".delete_hs").on("click", function (e) {
            var id = $(this).attr("id");
            if (confirm("Xác nhận xóa hồ sơ này ?")) {
                var url = $(this).attr('href');
                var pathname = window.location.href;
                var result = pathname.split('?');
                if (result[1] !== "undefined") {
                    url += "&" + result[1];
                }
                location.href = url;
            }
            return false;
        });
    });
</script>
@if(Session::has('success')) 
<script type="text/javascript">
    toastr.success("{{Session::get('success')}}");
</script>
@endif
@if(Session::has('error')) 
<script type="text/javascript">
    toastr.error("{{Session::get('error')}}");
</script>
@endif
@if(isset($warning)) 
<script type="text/javascript">
    toastr.warning("{{$warning}}");
    window.history.pushState(null, "{{$title}}", "{{$url}}");
</script>
@endif